package com.ljw.util;

import org.apache.commons.lang3.StringUtils;

/**
 * @author lijunwei
 * @date 2025/5/21
 */
public enum SceneTypeEnum {

    CHECK_PUNISHMENT("check", "检查处罚"),
    MANAGER_SCORE("manager", "管理积分总分处罚"),
    CREDIT_SCORE("credit", "信誉分总分处罚"),

    RISK_MANAGE("risk", "风控处罚");

    private String sceneCode;

    private String sceneDesc;

    SceneTypeEnum(String sceneCode, String sceneDesc) {
        this.sceneCode = sceneCode;
        this.sceneDesc = sceneDesc;
    }

    public String getSceneCode() {
        return sceneCode;
    }

    public String getSceneDesc() {
        return sceneDesc;
    }

    public static SceneTypeEnum getSceneTypeByCode(String sceneCode) {
        if (StringUtils.isBlank(sceneCode)) {
            return null;
        }

        for (SceneTypeEnum value : SceneTypeEnum.values()) {
            if (value.getSceneCode().equals(sceneCode)) {
                return value;
            }
        }
        return null;
    }
}
